<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Profile.aspx.cs" Inherits="ScrewTurn.Wiki.UserProfile" Title="Untitled Page" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="CtnProfile" ContentPlaceHolderID="CphMaster" Runat="Server">
    <script type="text/javascript">
    <!-- 
        function cvPassword_ClientValidate(source, args) {
	        var txtP1 = __GetServerElementById("txtPassword1").value
			var txtP2 = __GetServerElementById("txtPassword2").value
			var bValid = true;
				  
			if((txtP1.length > 0) && (txtP2.length > 0)) {
		        bValid = (txtP1 == txtP2);
		    }
				  
            args.IsValid = bValid;
		}
				
		function cvEmail_ClientValidate(source, args) {
		    var txtE1 = __GetServerElementById("txtEmail1").value
			var txtE2 = __GetServerElementById("txtEmail2").value
			var bValid = true;
				  
		    if((txtE1.length > 0) && (txtE2.length > 0)) {
			    bValid = (txtE1 == txtE2);
		    }
				  
            args.IsValid = bValid;
		}
    // -->
    </script>
    
    <h1 class="pagetitlesystem"><asp:Literal ID="lblTitle" runat="server" meta:resourcekey="lblTitleResource1" Text="User Profile" /></h1>
   
    <p><asp:Literal ID="lblDescription" runat="server" meta:resourcekey="lblDescriptionResource1" Text="Welcome to your Profile, " />
        <b><asp:Literal ID="lblUsername" runat="server" meta:resourcekey="lblUsernameResource1" /></b><br />
        <asp:Literal ID="lblInfo" runat="server" meta:resourcekey="lblInfoResource1" Text="Here you can edit your Profile settings, such as Email address and Password. You cannot change your Username." />
    </p> 
    <br /> 
   
    <table cellpadding="0" cellspacing="4">
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblAccountTypeDescription" runat="server" meta:resourcekey="lblAccountTypeDescriptionResource1" Text="Account type" />: </p></td>
            <td style="width: 349px"><p><b><asp:Literal ID="lblAccountType" runat="server" meta:resourcekey="lblAccountTypeResource1" /></b></p></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td style="width: 349px">&nbsp;</td>
        </tr>
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblEmail1" runat="server" meta:resourcekey="lblEmail1Resource1" Text="Email" />: </p></td>
            <td style="width: 349px">
                <asp:TextBox ID="txtEmail1" runat="server" Width="200px" meta:resourcekey="txtEmail1Resource1" ToolTip="Type here your Email address" CausesValidation="True" ValidationGroup="vgEmail" />
                <asp:RequiredFieldValidator ID="rfvEmail1" runat="server" ControlToValidate="txtEmail1" EnableTheming="False"
				    ValidationGroup="vgEmail"><img src="Images/InputError.png" alt="*" /></asp:RequiredFieldValidator>
			    <asp:RegularExpressionValidator ID="rxvEmail1" runat="server" ControlToValidate="txtEmail1" EnableTheming="False"
					ValidationExpression="^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})$"
					ValidationGroup="vgEmail"><img src="Images/InputError.png" alt="*" /></asp:RegularExpressionValidator>
			    <asp:CustomValidator ID="cvEmail1" runat="server" ClientValidationFunction="cvEmail_ClientValidate"
					ControlToValidate="txtEmail1" EnableTheming="False" OnServerValidate="cvEmail1_ServerValidate" ValidationGroup="vgEmail"><img src="Images/InputError.png" alt="*" /></asp:CustomValidator>
			</td>
        </tr>
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblEmail2" runat="server" meta:resourcekey="lblEmail2Resource1" Text="Email (repeat)"></asp:Literal>: </p></td>
            <td style="width: 349px"><asp:TextBox ID="txtEmail2" runat="server" Width="200px" meta:resourcekey="txtEmail2Resource1" ToolTip="Repeat your Email address" CausesValidation="True" ValidationGroup="vgEmail" />
                <asp:RequiredFieldValidator ID="rfvEmail2" runat="server" ControlToValidate="txtEmail2" EnableTheming="False"
				    ValidationGroup="vgEmail"><img src="Images/InputError.png" alt="*" /></asp:RequiredFieldValidator>
				<asp:CustomValidator ID="cvEmail2" runat="server" ClientValidationFunction="cvEmail_ClientValidate"
			        ControlToValidate="txtEmail2" EnableTheming="False"
					OnServerValidate="cvEmail2_ServerValidate" ValidationGroup="vgEmail"><img src="Images/InputError.png" alt="*" /></asp:CustomValidator>
		    </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td style="width: 349px"><p>
                <asp:Button ID="btnSaveEmail" runat="server" Text="Save Email" OnClick="btnSaveEmail_Click" meta:resourcekey="btnSaveEmailResource1" ToolTip="Click here to save your Email address" ValidationGroup="vgEmail" /> 
                <asp:Label ID="lblSaveEmailResult" runat="server" meta:resourcekey="lblSaveEmailResultResource1" />
                </p> 
			    <p><asp:ValidationSummary ID="vsEmail" runat="server" CssClass="resulterror" ValidationGroup="vgEmail" Width="100%" /></p>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td style="width: 349px">&nbsp;</td>
        </tr>
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblOldPassword" runat="server" meta:resourcekey="lblOldPasswordResource1" Text="Old Password"></asp:Literal>: </p></td>
            <td style="width: 349px"><asp:TextBox ID="txtOldPassword" runat="server" Width="200px" TextMode="Password" meta:resourcekey="txtOldPasswordResource1" ToolTip="Type here your current Password" CausesValidation="True" ValidationGroup="vgPassword" />
                <asp:RequiredFieldValidator ID="rfvOldPassword" runat="server" ControlToValidate="txtOldPassword" EnableTheming="False"
				    ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:RequiredFieldValidator>
				<asp:CustomValidator ID="cvOldPassword" runat="server" ControlToValidate="txtOldPassword"
					EnableTheming="False" OnServerValidate="cvOldPassword_ServerValidate" ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:CustomValidator>
		    </td>
        </tr>
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblPassword1" runat="server" meta:resourcekey="lblPassword1Resource1" Text="Password" />: </p></td>
            <td style="width: 349px"><asp:TextBox ID="txtPassword1" runat="server" Width="200px" TextMode="Password" meta:resourcekey="txtPassword1Resource1" ToolTip="Type here your new Password" CausesValidation="True" ValidationGroup="vgPassword" />
                <asp:RequiredFieldValidator ID="rfvPassword1" runat="server" ControlToValidate="txtPassword1" EnableTheming="False"
					ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:RequiredFieldValidator>
				<asp:RegularExpressionValidator ID="rxvPassword1" runat="server" ControlToValidate="txtPassword1" EnableTheming="False"
					ValidationExpression="^(\w{8,})$" ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:RegularExpressionValidator>
				<asp:CustomValidator ID="cvPassword1" runat="server" ClientValidationFunction="cvPassword_ClientValidate"
					ControlToValidate="txtPassword1" EnableTheming="False"
					OnServerValidate="cvPassword1_ServerValidate" ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:CustomValidator>
			</td>
        </tr>
        <tr>
            <td><p style="text-align: right;"><asp:Literal ID="lblPassword2" runat="server" meta:resourcekey="lblPassword2Resource1" Text="Password (repeat)" />: </p></td>
            <td style="width: 349px"><asp:TextBox ID="txtPassword2" runat="server" Width="200px" TextMode="Password" meta:resourcekey="txtPassword2Resource1" ToolTip="Repeat your new Password" CausesValidation="True" ValidationGroup="vgPassword" />
                <asp:RequiredFieldValidator ID="rfvPassword2" runat="server" ControlToValidate="txtPassword2" EnableTheming="False"
					ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:RequiredFieldValidator>
			    <asp:CustomValidator ID="cvPassword2" runat="server" ClientValidationFunction="cvPassword_ClientValidate"
					ControlToValidate="txtPassword2" EnableTheming="False"
				    OnServerValidate="cvPassword2_ServerValidate" ValidationGroup="vgPassword"><img src="Images/InputError.png" alt="*" /></asp:CustomValidator>
		    </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td style="width: 349px">
                <p>
                    <asp:Button ID="btnSavePassword" runat="server" Text="Save Password" OnClick="btnSavePassword_Click" meta:resourcekey="btnSavePasswordResource1" ToolTip="Click here to save your new Password" /> 
                    <asp:Label ID="lblSavePasswordResult" runat="server" meta:resourcekey="lblSavePasswordResultResource1" />
				    <asp:ValidationSummary ID="vsPassword" runat="server" CssClass="resulterror" ValidationGroup="vgPassword" Width="100%" />
                </p> 
            </td>
        </tr>
    </table>
   
    <br />
    <h2 class="separator"><asp:Literal ID="lblDeleteAccount" runat="server" Text="Delete Account" meta:resourcekey="lblDeleteAccountResource1"></asp:Literal></h2>
    <p><asp:Literal ID="lblDeleteAccountInfo" runat="server" Text="You can delete your account by clicking on the Delete Account button and then confirming with the Confirm button.<br /><b>Warning</b>: the operation is irreversible." meta:resourcekey="lblDeleteAccountInfoResource1" /></p>
    <br /> 
    <asp:Button ID="btnDeleteAccount" runat="server" Text="Delete Account" OnClick="btnDeleteAccount_Click" meta:resourcekey="btnDeleteAccountResource1" />
    <asp:Button ID="btnConfirm" runat="server" Text="Confirm" Enabled="False" OnClick="btnConfirm_Click" meta:resourcekey="btnConfirmResource1" />

</asp:Content>
